package com.vint.mi;


/**
 * 求数值的反向值, 这里的反向指的是二进制的反向
 * 输入32位无符号数
 */
public class Mi30 {
    public static String solution(String line){
        long src = Long.parseLong(line);
        long sum  = 0;
        int count = 0;
        while(src!=0){
            long v = src % 2;
            sum = sum * 2 + v;
            src /= 2;
            count++;
        }

        return Long.toString(sum*(long)Math.pow(2,32-count));
    }
    public static void main(String[] args) {
        System.out.println(solution("1"));
    }
}
